@charset "utf-8";
$color: #1EC862;

// 线性渐变(deg, start-color, end-color);
@mixin linearGradient($deg: -120deg, $rgba: $color1, $rgba2: $color2) {
  background: -webkit-linear-gradient($deg, $rgba, $rgba2);
  background: -o-linear-gradient($deg, $rgba, $rgba2);
  background: -moz-linear-gradient($deg, $rgba, $rgba2);
  background: linear-gradient($deg, $rgba, $rgba2);
}

// 水平居中(position || transform)
@mixin horizontal($type: position) {
  @if $type == position {
    position: absolute;
    left: 0;
    right: 0;
    margin: 0 auto;
  }
  @if $type == transform {
    position: relative;
    left: 50%;
    @include x(-50%);
  }
}

// 垂直居中(position || transform)
@mixin vertical($type: position) {
  @if $type == position {
    position: absolute;
    top: 0;
    bottom: 0;
    margin: auto 0;
  }
  @if $type == transform {
    position: relative;
    top: 50%;
    @include y(-50%);
  }
}

// 整体居中(position || transform)
@mixin center($type: position) {
  @if $type == position {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
  }
  @if $type == transform {
    position: relative;
    top: 50%;
    left: 50%;
    @include transform(translateX(-50%) translateY(-50%));
  }
}


// 清除浮动引发的bug
@mixin clear {
  *zoom: 1;
  &:before,
  &:after {
    content: " ";
    display: table;
  }
  &:after {
    clear: both;
  }
}

// 宽高,disblock
@mixin a {
  width: 100%;
  height: 100%;
  display: block;
}

// placeholder的样式(input || textarea, font-size, color, font-weight)
@mixin placeholder($type, $value, $value2, $value3: "normal") {
  @if $type == input {
    input::-webkit-input-placeholder {
      font-size: $value;
      color: $value2;
      font-weight: $value3;
    }
    input:-moz-placeholder {
      font-size: $value;
      color: $value2;
      font-weight: $value3;
    }
    input::-moz-placeholder {
      font-size: $value;
      color: $value2;
      font-weight: $value3;
    }
    input:-ms-input-placeholder {
      font-size: $value;
      color: $value2;
      font-weight: $value3;
    }
  }
  @if $type == textarea {
    textarea::-webkit-input-placeholder {
      font-size: $value;
      color: $value2;
      font-weight: $value3;
    }
    textarea:-moz-placeholder {
      font-size: $value;
      color: $value2;
      font-weight: $value3;
    }
    textarea::-moz-placeholder {
      font-size: $value;
      color: $value2;
      font-weight: $value3;
    }
    textarea:-ms-input-placeholder {
      font-size: $value;
      color: $value2;
      font-weight: $value3;
    }
  }
}

// 三角
@mixin arrow($direction, $size, $color) {
  width: 0;
  height: 0;
  line-height: 0;
  font-size: 0;
  overflow: hidden;
  border-width: $size;
  cursor: pointer;
  @if $direction == top {
    border-style: dashed dashed solid dashed;
    border-color: transparent transparent $color transparent;
    border-top: none;
  } @else if $direction == bottom {
    border-style: solid dashed dashed dashed;
    border-color: $color transparent transparent transparent;
    border-bottom: none;
  } @else if $direction == right {
    border-style: dashed dashed dashed solid;
    border-color: transparent transparent transparent $color;
    border-right: none;
  } @else if $direction == left {
    border-style: dashed solid dashed dashed;
    border-color: transparent $color transparent transparent;
    border-left: none;
  }
}

// object-fit
@mixin fit($value: cover) {
  -o-object-fit: $value;
  object-fit: $value;
  -o-object-position: center;
  object-position: center;
  width: 100%;
  height: 100%;
}

// 超出内容省略号
@mixin elli {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


@mixin boxshadow($value: rgba(0, 0, 0, 0.3)) {
  box-shadow: 0 14px 46px 0 $value;
}

@mixin boxshadowLight($value: rgba(0, 0, 0, 0.3)) {
  box-shadow: 0 0px 20px 0 $value;
}

@mixin boxshadowLighter($value: rgba(0, 0, 0, 0.3)) {
  box-shadow: 0 0px 8px 0 $value;
}

._scroll {
  overflow: hidden;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}
._scroll::-webkit-scrollbar {
  width: 5px;
  height: 10px;
}

/*正常情况下滑块的样式*/
._scroll::-webkit-scrollbar-thumb {
  background-color: $color;
  border-radius: 0px;
  //-webkit-box-shadow: inset 1px 1px 0 rgba(0,0,0,.1);
  //transition: 0.5s;
}
/*鼠标悬浮在该类指向的控件上时滑块的样式*/
._scroll:hover::-webkit-scrollbar-thumb {
  background-color: $color;
  border-radius: 0px;
  //-webkit-box-shadow: inset 1px 1px 0 rgba(0,0,0,.1);
}
/*鼠标悬浮在滑块上时滑块的样式*/
._scroll::-webkit-scrollbar-thumb:hover {
  background-color: $color;
  //-webkit-box-shadow: inset 1px 1px 0 rgba(0,0,0,.1);
}
/*正常时候的主干部分*/
._scroll::-webkit-scrollbar-track {
  border-radius: 0px;
  background: #010302;
  //-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.4);
  //background-color: white;
}
/*鼠标悬浮在滚动条上的主干部分*/
._scroll::-webkit-scrollbar-track:hover {
  background: #010302;
  //-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.4);
  //background-color: rgba(0,0,0,.01);
}
